/*-------------------------------------------------------- 
* Module Name : OLSplashScreen
* Version : 1.0
* 
* Software Name : Qt App Template
* Version : 1.0
*
* Copyright � 2010 � 2011 France T�l�com
* This software is distributed under the LGPL v2.1 license,
* the text of which is available at http://www.gnu.org/licenses/lgpl-2.1.html
* or see the "LICENSE.txt" file for more details.
*
*--------------------------------------------------------
* File Name   : OLSplashScreen.h
*
* Created     : 07 June 2011
* Author(s)   : Omer Saleem
*
* Description :
* Object to represent the application's splash screen. Can
* support use of an image or customised layout.
*
*--------------------------------------------------------
* 1.0 - First open source release
*
*/

#ifndef OLSPLASHSCREEN_H
#define OLSPLASHSCREEN_H

#include <QtGui/QWidget>

class OLSplashScreen : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)

public:
    explicit OLSplashScreen(QWidget *parent = 0);

    void changeSplashScreenImage(const QString& pixmap);
    void changeSplashScreenLayout(QLayout* layout);
    void dismissSplashScreen();

    void setOpacity(qreal opacity);
    qreal opacity();

private slots:
    void handleTimer();
    void handleAppResize();
    void imageTransitionDone();

protected:
    // from QWidget
    virtual void paintEvent(QPaintEvent* e);
    virtual void resizeEvent(QResizeEvent *e);
private:
    qreal m_opacity;
    QPixmap m_logo;
    QPixmap m_image;
    QPixmap m_scaledimage;
    QPixmap m_oldscaledimage;
};

#endif // OLSPLASHSCREEN_H
